<?php 
include "includes/sesiones.php";
include "includes/comunes.php";
error_reporting(0);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style>
#caja {
background-color: #0489B1;
height: 130px;
width: 650px;
padding: 10px;
/*para Firefox*/
-moz-border-radius: 15px 15px 15px 15px;
/*para Safari y Chrome*/
-webkit-border-radius: 15px 15px 15px 15px;
/* para Opera */
border-radius: 15px 15px 15px 15px;
margin:5px;
font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
border: 2px solid #666;
opacity: 0.8;
    border: 10px solid #eee;
  
    /*Transition*/
    -webkit-transition: all 0.5s ease;
    -moz-transition: all 0.5s ease;
    -o-transition: all 0.5s ease;
  
    /*Reflection*/
    -webkit-box-reflect: below 0px -webkit-gradient(linear, left , left bottom, from(transparent), color-stop(.7, transparent), to(rgba(0,0,0,0.1)));
}

#caja:hover {
background-color: #0489B1;
height: 130px;
width: 650px;
padding: 10px;
/*para Firefox*/
-moz-border-radius: 15px 15px 15px 15px;
/*para Safari y Chrome*/
-webkit-border-radius: 15px 15px 15px 15px;
/* para Opera */
border-radius: 15px 15px 15px 15px;

margin:5px;
font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
border: 2px solid #666;
opacity: 1;
  
   /*Reflection*/
  -webkit-box-reflect: below 0px -webkit-gradient(linear, left , left bottom, from(transparent), color-stop(.7, transparent), to(rgba(0,0,0,0.4)));
  
   /*Glow*/
  -webkit-box-shadow: 0px 0px 20px rgba(255,255,255,0.8);
  -moz-box-shadow: 0px 0px 20px rgba(255,255,255,0.8);
  box-shadow: 0px 0px 20px rgba(255,255,255,0.8);
}
}
</style>
<!--libreria jquery central-->
<script src="jquery-ui/js/jquery-1.9.1.js"></script>
<!--fin libreria central-->
<!--librerias ui-->
<link href="jquery-ui/css/ui-lightness/jquery-ui-1.10.2.custom.css" rel="stylesheet"/>
<script src="jquery-ui/js/jquery-ui-1.10.2.custom.js"></script>
<!--fin libreria-->
<?php include "includes/metas.php";?>
<script language="JavaScript" type="text/javascript">
$(function()
{
 $('#vis').tooltip({
      track: true
    });
});
</script>
</head>

<body>
<div class="contenedor">
	<div class="cont">
    	<?php include "includes/head.php";?>
        <?php include "includes/menu.php";?>
        <div class="novedadescont">
        	<div class="novedadestitulo">
            	<div class="novetitulo2">Segmentos de Clientes</div></div>
            </div>
            <div class="novedadescolum">
             <?php
             $sql="select * from nivelesmorosidad where id>1 and id<8 order by id asc";
             $resnov= cons_ins($sql);
			 
			 
			 
             ?>


  <?php while ($reg=mysql_fetch_array($resnov)):
  //obtengo la fecha de ultima corrida
   $res=fecha_ultima_corrida($reg['id']);
   if (mysql_num_rows($res)>0)
      $ban=1;
	  else
	  $ban=0;
   
   $regFec=mysql_fetch_array($res);
   $fec=explode("-",$regFec['fecha']);
  
  ?>
            	<div id="caja">
                	<div><b><?php echo utf8_encode(strtoupper($reg['descripcion']))?></b></div>
					<table width="280" align="center">
					<tr>
					<td><b>Total Cred.:</b></td>
					<td><?php 
					if($ban==1)
						echo canOpe_nivel($reg['id'],$fec['1'],$fec['0']);
					else
						echo 0;
					?></td>
					</tr>
					<tr>
					<td><b>Total en $:</b></td>
					<td><?php 
					if($ban==1)
						echo  "$ ".obtener_deuda_total($reg['id'],$fec['1'],$fec['0']);
					else
						echo 0;
					
					?></td>
					</tr>
					<tr>
					<td><b>Total Gest.:</b></td>
					<td><?php 
					if($ban==1)
						echo  obtener_tot_gestiones($reg['id'],$fec['1'],$fec['0']);
					else
						echo 0;
					
					?></td>
					</tr>
					<tr>
					<td colspan="2"> <a href="ListarUnSegmento.php?niv=<?php echo $reg['id']?>"><img src="images/visualizar.png" border="0" width="25px" id="vis" alt="Visualizar Segmento" title="Visualizar Segmento"/></a> </td>
					
					</tr>
					</table>
               </div>
 <?php

 endwhile ?>
               


            </div>


            <div class="novedadesbottom"></div>
        </div>

    <div class="separador"></div>
  
<?php include "includes/menufooter.php";?>
    
    
	<div id="clearing"></div>    
    </div>
<div id="clearing"></div>
</div>
</body>
</html>
